package com.java1234.test;

import com.java1234.entity.People;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class T {

    private ApplicationContext applicationContext;

    @Before
    public void setUp() throws Exception {
        applicationContext = new ClassPathXmlApplicationContext("beans.xml");
    }

    /**
     * 基本类型值
     */
    @Test
    public void test1() {
        People people = (People) applicationContext.getBean("people1");
        People people2 = (People) applicationContext.getBean("people1");
        System.out.println(people.getDog() == people2.getDog());

        System.out.println(applicationContext.getBean("dog") == applicationContext.getBean("dog"));
    }


}
